home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Tools & Apps / Misc. Utilities / Installer 3.4 / Examples - Installer 3.4 / SimpleEasyOnly.r < prev   
Encoding:
Text File  |  1992-09-21  |  4.7 KB  |  125 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: very simple installation (Easy Installation only)
  6.  *
  7.  *    File:        SimpleEasyOnly.r -    Rez Source
  8.  *
  9.  *    by:            Jon Zap
  10.  *  updated for use with Installer 3.4 by: Rich Kubota 9/1/92
  11.  *
  12.  *    Copyright © 1991 Apple Computer, Inc.
  13.  *    All rights reserved.
  14.  *
  15.  *------------------------------------------------------------------------------
  16.  *
  17.  * Install application "TeachText" into the folder "Root":Installed Application
  18.  * It demonstrates only Easy Installation (Custom Installation is not supported)
  19.  *----------------------------------------------------------------------------*/
  20.  
  21. #include "InstallerTypes.r"
  22.  
  23. /* You can build and complete the script with the following lines:
  24. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  25. # or set up folders with the same names and contents as the floppies
  26. # put these folders in the same folder as the script or at the root directory of same disk
  27.  
  28.     rez -o "SimpleEasyOnly" -t 'bbkr' -c 'bbkr' "SimpleEasyOnly.r"
  29.     setfile -a i "SimpleEasyOnly"        #mark Inited
  30.     scriptcheck -p "SimpleEasyOnly"
  31. */
  32.  
  33. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  34. #define kScriptCheckSetsDate    0x01
  35.  
  36. /* Definitions for the rule */
  37. #define rlDoInstall                1000
  38.  
  39. /* Definitions for the file spec atoms (specifications for source and destination files) */
  40. #define fsSourceProgram            2000
  41. #define fsTargetProgram            2001
  42.  
  43. /* This is the name of the source disk */
  44. #define ProgramDisk "Program Disk:"
  45.  
  46. /* This is the target path for where we want to install the file. */
  47. #define TargetPath    ":Installed Application:"
  48.  
  49. /* Definition for the package. */
  50. #define pkTheProgram            3000
  51.  
  52. /* Definition for the file atom */
  53. #define faProgram                4000
  54.  
  55. /************************** Rule resources for Easy Install **********************************/
  56.  
  57. /* need 1 and only 1 framework to tell the installer how to process the rule(s) */
  58. resource 'infr' (1) {
  59.     format0  {{
  60.         pickAll,    {rlDoInstall},    /* Process "all" of the rules */
  61.     }};
  62. };
  63.  
  64. resource 'inrl' (rlDoInstall) {
  65.     format0 {{
  66.         addUserDescription {"Click Install button to install\n"}, /* message to appear in Easy Install screen */
  67.         addUserDescription {"• TeachText\n"},        /* message to appear in Easy Install screen */
  68.         addPackages {{pkTheProgram}}                /* we're only installing the program */
  69.     }};
  70. };
  71. /***************************** Package Resources ************************************************/
  72. resource 'inpk' (pkTheProgram) {
  73.     format0 {
  74.         doesntShowOnCustom,         /* Package doesn't appear in the Custom Install display */
  75.         removable,                    /* Package can be removed */
  76.         dontForceRestart,            /* no need to reboot after live install */
  77.         0,                             /* 'icmt' not used in a package that does not show on custom */
  78.         0,                            /* Package size (filled in by ScriptCheck) */
  79.         "", {                        /* package name not used in a package that does not show on custom    */
  80.             'infa', faProgram;
  81.         }
  82.     }
  83. };
  84.  
  85. /********************************************* File Specs ***********************************************/
  86. /* Source File Specs */
  87. resource 'infs' (fsSourceProgram) {
  88.     'APPL',                                /* File Type */
  89.     'ttxt',                                /* Creator */
  90.     kScriptCheckSetsDate,                /* ScriptCheck will fill in the creation date */
  91.     noSearchForFile,                    /* Do not search the source disk for the file */
  92.     typeCrMustMatch,                    /* file type and creator on this file must match */
  93.     ProgramDisk"TeachText"                /* Path to the file */
  94. };
  95.  
  96. /* Target File Specs */
  97. resource 'infs' (fsTargetProgram) {
  98.     'APPL',                                /* File Type */
  99.     'ttxt',                                /* Creator */
  100.     0,                                    /* not needed for target file spec */
  101.     noSearchForFile,                    /* Do not search the target disk for the file */
  102.     typeCrMustMatch,                    /* not needed for target file specs */
  103.     TargetPath"TeachText"                /* installation Path */
  104. };
  105.  
  106. /******************************************** File Atoms ************************************************/
  107. resource 'infa' (faProgram) {
  108.     format0 {
  109.         deleteWhenRemoving,                /* Delete the file if remove is clicked(option-custom) */
  110.         dontDeleteWhenInstalling,         /* don't need to predelete the target before copying new one */
  111.         copy,                             /* Copy the file to the destination */
  112.         leaveAloneIfNewer,                 /* do not Install this version, if newer one exists */
  113.         updateExisting,                 /* replace an existing copy, if mine is newer */
  114.         copyIfNewOrUpdate,                /* Copy whether the target file exists or not */
  115.         rsrcFork, dataFork,                /* Copy both forks of the file */
  116.         fsTargetProgram,                /* TARGET file spec */
  117.         fsSourceProgram,                 /* SOURCE file spec */
  118.         0,                                /* atom size (filled in by ScriptCheck) */
  119.         ""                                /* Atom Description (for a file Installer will use file name) */
  120.     };
  121. };
  122.  
  123.  
  124.  
  125.